package servlets;

import java.io.IOException;
import java.util.Vector;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import negocio.Professor;
import controle.Fachada;

/**
 * Servlet implementation class ExibirCadastroDisciplina
 */
public class ExibirCadastroDisciplina extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ExibirCadastroDisciplina() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Fachada fac = Fachada.obterInstancia();
		Vector<Professor> listaProfessores = fac.listarProfessores();
		request.setAttribute("prof", listaProfessores);
		getServletContext().getRequestDispatcher("/cadDisciplina.jsp").forward(request, response);
	}
	

}
